package com.cuit.food.food.Yservice;

import com.cuit.food.Resturant;
import com.cuit.food.food.Ydao.resRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

@Service
public class resturantservice {
    @Autowired
    resRepository resrepository;


    public String GetRetName(String id) {
       return Objects.requireNonNull(resrepository.findById(id).orElse(null)).getName();
    }

    public  List<Resturant> findall() {
        return resrepository.findAll();
    }

}
